VERSION 5.00
Begin VB.Form frmTietDienCotDam 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Tiet dien COT - DAM"
   ClientHeight    =   4290
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8565
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   9.75
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "TietDienCotDam.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4290
   ScaleWidth      =   8565
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdOK 
      Cancel          =   -1  'True
      Caption         =   "&OK"
      Height          =   435
      Left            =   7260
      TabIndex        =   16
      Top             =   3780
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Caption         =   "Tiet dien DAM:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3615
      Index           =   1
      Left            =   4320
      TabIndex        =   27
      Top             =   60
      Width           =   4155
      Begin VB.TextBox txtRb 
         Height          =   360
         Left            =   2880
         TabIndex        =   15
         Text            =   "txtRb"
         Top             =   2760
         Width           =   1155
      End
      Begin VB.ComboBox cboLoaiTietDienDam 
         Height          =   360
         ItemData        =   "TietDienCotDam.frx":030A
         Left            =   120
         List            =   "TietDienCotDam.frx":030C
         Style           =   2  'Dropdown List
         TabIndex        =   8
         Top             =   660
         Width           =   1515
      End
      Begin VB.TextBox txtHb 
         Height          =   360
         Left            =   2880
         TabIndex        =   11
         Text            =   "txtHb"
         Top             =   1080
         Width           =   1155
      End
      Begin VB.TextBox txtTwb 
         Height          =   360
         Left            =   2880
         TabIndex        =   12
         Text            =   "txtTwb"
         Top             =   1500
         Width           =   1155
      End
      Begin VB.TextBox txtBb 
         Height          =   360
         Left            =   2880
         TabIndex        =   13
         Text            =   "txtBb"
         Top             =   1920
         Width           =   1155
      End
      Begin VB.TextBox txtTfb 
         Height          =   360
         Left            =   2880
         TabIndex        =   14
         Text            =   "txtTfb"
         Top             =   2340
         Width           =   1155
      End
      Begin VB.ComboBox cboKieuDam 
         Height          =   360
         ItemData        =   "TietDienCotDam.frx":030E
         Left            =   1740
         List            =   "TietDienCotDam.frx":0310
         Style           =   2  'Dropdown List
         TabIndex        =   9
         Top             =   660
         Width           =   1035
      End
      Begin VB.ComboBox cboSoHieuDam 
         Height          =   360
         ItemData        =   "TietDienCotDam.frx":0312
         Left            =   2880
         List            =   "TietDienCotDam.frx":0314
         Style           =   2  'Dropdown List
         TabIndex        =   10
         Top             =   660
         Width           =   1155
      End
      Begin VB.Label lblHw 
         Caption         =   "Chieu cao tiet dien (cm):"
         Height          =   285
         Index           =   7
         Left            =   120
         TabIndex        =   35
         Top             =   1140
         Width           =   2715
      End
      Begin VB.Label lblTw 
         Caption         =   "Chieu day ban bung (cm):"
         Height          =   285
         Index           =   1
         Left            =   120
         TabIndex        =   34
         Top             =   1560
         Width           =   2715
      End
      Begin VB.Label lblBf1 
         Caption         =   "Be rong ban canh (cm):"
         Height          =   285
         Index           =   1
         Left            =   120
         TabIndex        =   33
         Top             =   1980
         Width           =   2715
      End
      Begin VB.Label lblTf1 
         Caption         =   "Chieu day ban canh (cm):"
         Height          =   345
         Index           =   1
         Left            =   120
         TabIndex        =   32
         Top             =   2400
         Width           =   2715
      End
      Begin VB.Label lblTf2 
         Caption         =   "Ban kinh cong chuyen tiep canh-bung:"
         Height          =   525
         Index           =   2
         Left            =   120
         TabIndex        =   31
         Top             =   3060
         Width           =   2715
      End
      Begin VB.Label lblHw 
         Caption         =   "Loai tiet dien:"
         Height          =   285
         Index           =   6
         Left            =   120
         TabIndex        =   30
         Top             =   300
         Width           =   1455
      End
      Begin VB.Label lblHw 
         Caption         =   "Kieu:"
         Height          =   285
         Index           =   5
         Left            =   1740
         TabIndex        =   29
         Top             =   300
         Width           =   975
      End
      Begin VB.Label lblHw 
         Caption         =   "So hieu:"
         Height          =   285
         Index           =   4
         Left            =   2940
         TabIndex        =   28
         Top             =   300
         Width           =   975
      End
      Begin VB.Label lblTf2 
         Caption         =   "Chieu cao duong han (cm):"
         Height          =   345
         Index           =   3
         Left            =   120
         TabIndex        =   36
         Top             =   2820
         Width           =   2715
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Tiet dien COT:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3615
      Index           =   0
      Left            =   60
      TabIndex        =   17
      Top             =   60
      Width           =   4155
      Begin VB.ComboBox cboSoHieuCot 
         Height          =   360
         ItemData        =   "TietDienCotDam.frx":0316
         Left            =   2880
         List            =   "TietDienCotDam.frx":0318
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   660
         Width           =   1155
      End
      Begin VB.ComboBox cboKieuCot 
         Height          =   360
         ItemData        =   "TietDienCotDam.frx":031A
         Left            =   1740
         List            =   "TietDienCotDam.frx":031C
         Style           =   2  'Dropdown List
         TabIndex        =   1
         Top             =   660
         Width           =   1035
      End
      Begin VB.TextBox txtTfc 
         Height          =   360
         Left            =   2880
         TabIndex        =   6
         Text            =   "txtTfc"
         Top             =   2340
         Width           =   1155
      End
      Begin VB.TextBox txtBc 
         Height          =   360
         Left            =   2880
         TabIndex        =   5
         Text            =   "txtBc"
         Top             =   1920
         Width           =   1155
      End
      Begin VB.TextBox txtTwc 
         Height          =   360
         Left            =   2880
         TabIndex        =   4
         Text            =   "txtTwc"
         Top             =   1500
         Width           =   1155
      End
      Begin VB.TextBox txtHc 
         Height          =   360
         Left            =   2880
         TabIndex        =   3
         Text            =   "txtHc"
         Top             =   1080
         Width           =   1155
      End
      Begin VB.ComboBox cboLoaiTietDienCot 
         Height          =   360
         ItemData        =   "TietDienCotDam.frx":031E
         Left            =   120
         List            =   "TietDienCotDam.frx":0320
         Style           =   2  'Dropdown List
         TabIndex        =   0
         Top             =   660
         Width           =   1515
      End
      Begin VB.TextBox txtRc 
         Height          =   360
         Left            =   2880
         TabIndex        =   7
         Text            =   "txtRc"
         Top             =   2760
         Width           =   1155
      End
      Begin VB.Label lblHw 
         Caption         =   "So hieu:"
         Height          =   285
         Index           =   3
         Left            =   2940
         TabIndex        =   26
         Top             =   300
         Width           =   975
      End
      Begin VB.Label lblHw 
         Caption         =   "Kieu:"
         Height          =   285
         Index           =   2
         Left            =   1740
         TabIndex        =   25
         Top             =   300
         Width           =   975
      End
      Begin VB.Label lblHw 
         Caption         =   "Loai tiet dien:"
         Height          =   285
         Index           =   1
         Left            =   120
         TabIndex        =   24
         Top             =   300
         Width           =   1455
      End
      Begin VB.Label lblTf2 
         Caption         =   "Ban kinh cong chuyen tiep canh-bung:"
         Height          =   525
         Index           =   0
         Left            =   120
         TabIndex        =   23
         Top             =   3060
         Width           =   2715
      End
      Begin VB.Label lblTf1 
         Caption         =   "Chieu day ban canh (cm):"
         Height          =   345
         Index           =   0
         Left            =   120
         TabIndex        =   22
         Top             =   2400
         Width           =   2715
      End
      Begin VB.Label lblBf1 
         Caption         =   "Be rong ban canh (cm):"
         Height          =   285
         Index           =   0
         Left            =   120
         TabIndex        =   21
         Top             =   1980
         Width           =   2715
      End
      Begin VB.Label lblTw 
         Caption         =   "Chieu day ban bung (cm):"
         Height          =   285
         Index           =   0
         Left            =   120
         TabIndex        =   20
         Top             =   1560
         Width           =   2715
      End
      Begin VB.Label lblHw 
         Caption         =   "Chieu cao tiet dien (cm):"
         Height          =   285
         Index           =   0
         Left            =   120
         TabIndex        =   19
         Top             =   1140
         Width           =   2715
      End
      Begin VB.Label lblTf2 
         Caption         =   "Chieu cao duong han (cm):"
         Height          =   345
         Index           =   1
         Left            =   120
         TabIndex        =   18
         Top             =   2820
         Width           =   2715
      End
   End
End
Attribute VB_Name = "frmTietDienCotDam"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cboKieuCot_Click()
     Dim i As Integer
     
     cboSoHieuCot.Clear
     Select Case cboKieuCot.ListIndex
     Case 0 'I
          For i = 1 To UBound(ProI, 1)
               cboSoHieuCot.AddItem ProI(i, 1)
          Next i
          cboSoHieuCot.ListIndex = 0
     Case 1 'IPE
          For i = 1 To UBound(ProIPE, 1)
               cboSoHieuCot.AddItem ProIPE(i, 1)
          Next i
          cboSoHieuCot.ListIndex = 0
     Case 2 'HEA
          For i = 1 To UBound(ProHEA, 1)
               cboSoHieuCot.AddItem ProHEA(i, 1)
          Next i
          cboSoHieuCot.ListIndex = 0
     Case 3 'HEB
          For i = 1 To UBound(ProHEB, 1)
               cboSoHieuCot.AddItem ProHEB(i, 1)
          Next i
          cboSoHieuCot.ListIndex = 0
     Case 4 'HEM
          For i = 1 To UBound(ProHEM, 1)
               cboSoHieuCot.AddItem ProHEM(i, 1)
          Next i
          cboSoHieuCot.ListIndex = 0
     End Select
End Sub

Private Sub cboKieuDam_Click()
     Dim i As Integer
     
     cboSoHieuDam.Clear
     Select Case cboKieuDam.ListIndex
     Case 0 'I
          For i = 1 To UBound(ProI, 1)
               cboSoHieuDam.AddItem ProI(i, 1)
          Next i
          cboSoHieuDam.ListIndex = 0
     Case 1 'IPE
          For i = 1 To UBound(ProIPE, 1)
               cboSoHieuDam.AddItem ProIPE(i, 1)
          Next i
          cboSoHieuDam.ListIndex = 0
     Case 2 'HEA
          For i = 1 To UBound(ProHEA, 1)
               cboSoHieuDam.AddItem ProHEA(i, 1)
          Next i
          cboSoHieuDam.ListIndex = 0
     Case 3 'HEB
          For i = 1 To UBound(ProHEB, 1)
               cboSoHieuDam.AddItem ProHEB(i, 1)
          Next i
          cboSoHieuDam.ListIndex = 0
     Case 4 'HEM
          For i = 1 To UBound(ProHEM, 1)
               cboSoHieuDam.AddItem ProHEM(i, 1)
          Next i
          cboSoHieuDam.ListIndex = 0
     End Select
End Sub


Private Sub cboLoaiTietDienCot_Click()
     If cboLoaiTietDienCot.ListIndex = 1 Then
          cboKieuCot.Enabled = False
          cboSoHieuCot.Enabled = False
     Else
          cboKieuCot.Enabled = True
          cboSoHieuCot.Enabled = True
     End If
End Sub


Private Sub cboLoaiTietDienDam_Click()
     If cboLoaiTietDienDam.ListIndex = 1 Then
          cboKieuDam.Enabled = False
          cboSoHieuDam.Enabled = False
     Else
          cboKieuDam.Enabled = True
          cboSoHieuDam.Enabled = True
     End If
End Sub


Private Sub cboSoHieuCot_Click()
     Dim j As Integer
     Select Case cboKieuCot.Text
     Case "I"
          For j = 1 To UBound(ProI, 1)
               If cboSoHieuCot.Text = CStr(ProI(j, 1)) Then
                    txtHc.Text = ProI(j, 2)
                    txtTwc.Text = ProI(j, 4)
                    txtBc.Text = ProI(j, 3)
                    txtTfc.Text = ProI(j, 5)
                    txtRc.Text = ProI(j, 6)
                    Exit For
               End If
          Next j
     Case "IPE"
          For j = 1 To UBound(ProIPE, 1)
               If cboSoHieuCot.Text = CStr(ProIPE(j, 1)) Then
                    txtHc.Text = ProIPE(j, 2)
                    txtTwc.Text = ProIPE(j, 4)
                    txtBc.Text = ProIPE(j, 3)
                    txtTfc.Text = ProIPE(j, 5)
                    txtRc.Text = ProIPE(j, 6)
                    Exit For
               End If
          Next j
     Case "HEA"
          For j = 1 To UBound(ProHEA, 1)
               If cboSoHieuCot.Text = CStr(ProHEA(j, 1)) Then
                    txtHc.Text = ProHEA(j, 2)
                    txtTwc.Text = ProHEA(j, 4)
                    txtBc.Text = ProHEA(j, 3)
                    txtTfc.Text = ProHEA(j, 5)
                    txtRc.Text = ProHEA(j, 6)
                    Exit For
               End If
          Next j
     Case "HEB"
          For j = 1 To UBound(ProHEB, 1)
               If cboSoHieuCot.Text = CStr(ProHEB(j, 1)) Then
                    txtHc.Text = ProHEB(j, 2)
                    txtTwc.Text = ProHEB(j, 4)
                    txtBc.Text = ProHEB(j, 3)
                    txtTfc.Text = ProHEB(j, 5)
                    txtRc.Text = ProHEB(j, 6)
                    Exit For
               End If
          Next j
     Case "HEM"
          For j = 1 To UBound(ProHEM, 1)
               If cboSoHieuCot.Text = CStr(ProHEM(j, 1)) Then
                    txtHc.Text = ProHEM(j, 2)
                    txtTwc.Text = ProHEM(j, 4)
                    txtBc.Text = ProHEM(j, 3)
                    txtTfc.Text = ProHEM(j, 5)
                    txtRc.Text = ProHEM(j, 6)
                    Exit For
               End If
          Next j
     End Select
End Sub


Private Sub cboSoHieuDam_Click()
     Dim j As Integer
     Select Case cboKieuDam.Text
     Case "I"
          For j = 1 To UBound(ProI, 1)
               If cboSoHieuDam.Text = CStr(ProI(j, 1)) Then
                    txtHb.Text = ProI(j, 2)
                    txtTwb.Text = ProI(j, 4)
                    txtBb.Text = ProI(j, 3)
                    txtTfb.Text = ProI(j, 5)
                    txtRb.Text = ProI(j, 6)
                    Exit For
               End If
          Next j
     Case "IPE"
          For j = 1 To UBound(ProIPE, 1)
               If cboSoHieuDam.Text = CStr(ProIPE(j, 1)) Then
                    txtHb.Text = ProIPE(j, 2)
                    txtTwb.Text = ProIPE(j, 4)
                    txtBb.Text = ProIPE(j, 3)
                    txtTfb.Text = ProIPE(j, 5)
                    txtRb.Text = ProIPE(j, 6)
                    Exit For
               End If
          Next j
     Case "HEA"
          For j = 1 To UBound(ProHEA, 1)
               If cboSoHieuDam.Text = CStr(ProHEA(j, 1)) Then
                    txtHb.Text = ProHEA(j, 2)
                    txtTwb.Text = ProHEA(j, 4)
                    txtBb.Text = ProHEA(j, 3)
                    txtTfb.Text = ProHEA(j, 5)
                    txtRb.Text = ProHEA(j, 6)
                    Exit For
               End If
          Next j
     Case "HEB"
          For j = 1 To UBound(ProHEB, 1)
               If cboSoHieuDam.Text = CStr(ProHEB(j, 1)) Then
                    txtHb.Text = ProHEB(j, 2)
                    txtTwb.Text = ProHEB(j, 4)
                    txtBb.Text = ProHEB(j, 3)
                    txtTfb.Text = ProHEB(j, 5)
                    txtRb.Text = ProHEB(j, 6)
                    Exit For
               End If
          Next j
     Case "HEM"
          For j = 1 To UBound(ProHEM, 1)
               If cboSoHieuDam.Text = CStr(ProHEM(j, 1)) Then
                    txtHb.Text = ProHEM(j, 2)
                    txtTwb.Text = ProHEM(j, 4)
                    txtBb.Text = ProHEM(j, 3)
                    txtTfb.Text = ProHEM(j, 5)
                    txtRb.Text = ProHEM(j, 6)
                    Exit For
               End If
          Next j
     End Select
End Sub


Private Sub cmdOK_Click()
     Unload Me
End Sub


Private Sub Form_Load()
     cboLoaiTietDienCot.AddItem "Thep hinh"
     cboLoaiTietDienCot.AddItem "Thep to hop"
     cboLoaiTietDienCot.ListIndex = 0
     cboLoaiTietDienDam.AddItem "Thep hinh"
     cboLoaiTietDienDam.AddItem "Thep to hop"
     cboLoaiTietDienDam.ListIndex = 0
     cboKieuCot.AddItem "I"
     cboKieuCot.AddItem "IPE"
     cboKieuCot.AddItem "HEA"
     cboKieuCot.AddItem "HEB"
     cboKieuCot.AddItem "HEM"
     cboKieuCot.ListIndex = 3
     cboKieuDam.AddItem "I"
     cboKieuDam.AddItem "IPE"
     cboKieuDam.AddItem "HEA"
     cboKieuDam.AddItem "HEB"
     cboKieuDam.AddItem "HEM"
     cboKieuDam.ListIndex = 1
End Sub


Private Sub txtBb_GotFocus()
     SelectTextFromTextBox txtBb
End Sub

Private Sub txtBb_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtBb_LostFocus()
     CheckValidNumberInputed txtBb
End Sub

Private Sub txtBc_GotFocus()
     SelectTextFromTextBox txtBc
End Sub

Private Sub txtBc_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtBc_LostFocus()
     CheckValidNumberInputed txtBc
End Sub

     
Private Sub txtHb_GotFocus()
     SelectTextFromTextBox txtHb
End Sub

Private Sub txtHb_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtHc_GotFocus()
     SelectTextFromTextBox txtHc
End Sub


Private Sub txtHc_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtHc_LostFocus()
     CheckValidNumberInputed txtHc
End Sub


Private Sub txtRb_GotFocus()
     SelectTextFromTextBox txtRb
End Sub

Private Sub txtRb_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtRb_LostFocus()
     CheckValidNumberInputed txtRb
End Sub

Private Sub txtRc_GotFocus()
     SelectTextFromTextBox txtRc
End Sub

Private Sub txtRc_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtRc_LostFocus()
     CheckValidNumberInputed txtRc
End Sub

Private Sub txtTfb_GotFocus()
     SelectTextFromTextBox txtTfb
End Sub

Private Sub txtTfb_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtTfb_LostFocus()
     CheckValidNumberInputed txtTfb
End Sub

     
Private Sub txtTfc_GotFocus()
     SelectTextFromTextBox txtTfc
End Sub

Private Sub txtTfc_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtTfc_LostFocus()
     CheckValidNumberInputed txtTfc
End Sub

Private Sub txtTwb_GotFocus()
     SelectTextFromTextBox txtTwb
End Sub

Private Sub txtTwb_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtTwb_LostFocus()
     CheckValidNumberInputed txtTwb
End Sub

Private Sub txtTwc_GotFocus()
     SelectTextFromTextBox txtTwc
End Sub

Private Sub txtTwc_KeyPress(KeyAscii As Integer)
     CheckValidNumberGT0WhileInput KeyAscii
End Sub


Private Sub txtTwc_LostFocus()
     CheckValidNumberInputed txtTwc
End Sub


